package com.rongchuan.wt.mapper;

import com.github.pagehelper.Page;
import com.rongchuan.wt.entity.Employee;
import com.rongchuan.wt.entity.EmployeeExport;
import com.rongchuan.wt.entity.EmployeePage;
import com.rongchuan.wt.entity.EmployeePageQueryDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface EmployeeMapper {


    void insert(Employee employee);

    @Select("select * from employee where id=#{id}")
    Employee selectById(Long id);

    @Update("update employee set status=#{status} where id=#{id}")
    void updateStatus(Employee employee);


    Page<Employee> pageQuery(EmployeePage employeePage);

    @Select("SELECT e.*,d.name  FROM  employee e left join department d on e.dep_id = d.id")
    List<EmployeeExport> exportBusinessData();


    @Select("select * from employee")
   List<Employee> selectAll();
}
